package com.dennytech.tac.net.api;

import org.json.JSONException;
import org.json.JSONObject;

import com.dennytech.tac.net.BaseApi;

public class AttractionInfoApi extends BaseApi {

	private int id;

	public void setID(int id) {
		this.id = id;
	}

	@Override
	public JSONObject query() {
		if (id == 0) {
			return null;
		}

		StringBuilder sb = new StringBuilder();
		sb.append(API_DOMAIN + "attractioninfo.json?id=" + id);

		String bytes = getRawStr(sb.toString());
		if (bytes == null) {
			return null;
		}

		JSONObject object;
		try {
			object = new JSONObject(bytes);
		} catch (JSONException e) {
			return null;
		}
		return object;
	}

}
